package org.itboys.member.entity;

import org.itboys.member.constant.MemberConstants;
import org.itboys.mongodb.entity.BaseLongIdEntity;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Indexed;
import org.mongodb.morphia.annotations.NotSaved;

import java.util.Date;

/**
 * 会员基本信息
 *
 * @author 土豪章
 */
@Entity(value = "Member", noClassnameStored = true)
public class Member extends BaseLongIdEntity {

    private static final long serialVersionUID = 3177753808120877534L;

    public Member() {
    }

    public Member(String username, String nickname, String mobile, String thirdType, String thirdObjId, Long weixinId, String openId, Long recId, Integer sex, String logo) {
        this.username = username;
        this.nickname = nickname;
        this.mobile = mobile;
        this.thirdType = thirdType;
        this.thirdObjId = thirdObjId;
        this.weixinId = weixinId;
        this.openId = openId;
        this.recId = recId;
        this.sex = sex;
        this.logo = logo;
    }

    private Integer regNametype = MemberConstants.TYPE_ONE;// 手机 邮箱 或 用户名  1:手机  2：邮箱  3：用户名
    private Long sellerId;//会员所属的店铺ID
    private Long centerId;//所属运营中心Id
    private String username; //用户名
    private String nickname;//昵称
    private String signature; //签名
    private String city; //城市
    private String profession;//职业
    private String email; //邮箱
    private String idcard; //身份证号码
    private String mobile;//手机号
    private String password;
    private String path; //会员路径
    private Integer isView = MemberConstants.TYPE_ZERO;//是否创客 0： 普通用户 ;1：创客；
    private Integer type = MemberConstants.TYPE_ONE;//会员类型 1：运营中心 2：店铺 3：店铺会员 4:企业会员
    private Integer isBuyer = MemberConstants.TYPE_ZERO; //0-虚拟会员 1-正常会员
    private Integer status = MemberConstants.TYPE_ZERO;//0:创建状态 1:基本信息填完状态 -1:冻结账号
    private Integer level = MemberConstants.TYPE_ZERO;//会员等级
    @Indexed
    private String thirdType = MemberConstants.THIRD_TYPE_APP;//三方登入类型 比如 微信登入 QQ登入 支付宝登入 等等
    @Indexed
    private String thirdObjId;//三方会员的ID  比如是微信登录   thirdObjId=weixinUserID
    @Indexed
    private Long weixinId;//weixinconfig表的ID
    @Indexed
    private String openId;
    private Long recId; //推荐人Id
    private Long birthday;//会员生日
    private Integer sex = 1;//会员性别 1:男  2：女
    private String logo;//会员头像
    private Date regTime;//注册时间
    private String remark;//备注  用于解释冻结原因
    private Boolean readed = false;//是否阅读过招标须知 默认false 为true后不改
    private Integer score;//积分

    @NotSaved
    private String centerName; //所属运营中心名称
    @NotSaved
    private String sellerName; //所属店铺名称
    @NotSaved
    private String recName; //推荐人昵称

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public Long getWeixinId() {
        return weixinId;
    }

    public void setWeixinId(Long weixinId) {
        this.weixinId = weixinId;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Long getSellerId() {
        return sellerId;
    }

    public void setSellerId(Long sellerId) {
        this.sellerId = sellerId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getRegNametype() {
        return regNametype;
    }

    public void setRegNametype(Integer regNametype) {
        this.regNametype = regNametype;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getThirdType() {
        return thirdType;
    }

    public void setThirdType(String thirdType) {
        this.thirdType = thirdType;
    }

    public String getThirdObjId() {
        return thirdObjId;
    }

    public void setThirdObjId(String thirdObjId) {
        this.thirdObjId = thirdObjId;
    }

    public Long getBirthday() {
        return birthday;
    }

    public void setBirthday(Long birthday) {
        this.birthday = birthday;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public Date getRegTime() {
        return regTime;
    }

    public void setRegTime(Date regTime) {
        this.regTime = regTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Boolean getReaded() {
        return readed;
    }

    public void setReaded(Boolean readed) {
        this.readed = readed;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Integer getIsBuyer() {
        return isBuyer;
    }

    public void setIsBuyer(Integer isBuyer) {
        this.isBuyer = isBuyer;
    }

    public Long getCenterId() {
        return centerId;
    }

    public void setCenterId(Long centerId) {
        this.centerId = centerId;
    }

    public String getCenterName() {
        return centerName;
    }

    public void setCenterName(String centerName) {
        this.centerName = centerName;
    }

    public String getSellerName() {
        return sellerName;
    }

    public void setSellerName(String sellerName) {
        this.sellerName = sellerName;
    }

    public Integer getIsView() {
        return isView;
    }

    public void setIsView(Integer isView) {
        this.isView = isView;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public Long getRecId() {
        return recId;
    }

    public void setRecId(Long recId) {
        this.recId = recId;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getProfession() {
        return profession;
    }

    public void setProfession(String profession) {
        this.profession = profession;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }

    public String getRecName() {
        return recName;
    }

    public void setRecName(String recName) {
        this.recName = recName;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }
}

